/**********************************************
*  Classes:   Particle
*  Desc:      A particle. Derives from BillboardNode
*  Author:    Vaios Kalpias-Ilias (C) 2008-2009
***********************************************/

#ifndef PARTICLE_H
#define PARTICLE_H

#include "BillboardNode.h"

class Particle : public BillboardNode
{
public:

	Particle() : m_iEnergy(0),
				 m_fSize(0.0f)
	{}
	~Particle()
	{}

	// getters - setters
	virtual const NodeType GetType() const
	{
		return NODE_PARTICLE;
	}

	const mth::Vector3& GetVelocity() const
	{
		return m_vVel;
	}
	
	const int GetEnergy() const
	{
		return m_iEnergy;
	}
	
	const float GetSize() const
	{
		return m_fSize;
	}
	
	
	void SetVelocity (const mth::Vector3& vel)
	{
		m_vVel = vel;
	}
	
	
	void SetEnergy(const int energy)
	{
		m_iEnergy = energy;
	}
	
	bool ReduceEnergy(int value)
	{
		m_iEnergy -= value;
		return m_iEnergy > 0;
	}

	void SetSize(const float size)
	{
		m_fSize = size;
		m_vScale = mth::Vector3(size, size, size);
	}

private:
	
	// velocity
	mth::Vector3 m_vVel;
	// energy
	int m_iEnergy;
	// size
	float m_fSize;

};

SmartPointer(Particle);

#endif